<?php 
include('header.php');
include('menu.php');
include('config.php');
include_once('connection/connection.php');
function getName($colName,$id)
{
	$sqlgetName="select distinct ".$colName."_name from tbl_lookup_location where ".$colName."_id=".$id;
	$querygetName=mysql_query($sqlgetName);
	$rowgetName=mysql_fetch_row($querygetName);
	return $rowgetName[0];
}
$scheme=isset($_REQUEST['scheme'])?$_REQUEST['scheme']:"";
if($scheme==1)
{
 $scheme="P&T";
}
if($scheme==2)
{
 $scheme="Piped";
}
if($scheme==3)
{
 $scheme="RWSS";
}
if($scheme==4)
{
 $scheme="Sanitary Diggs";
}
if($scheme==5)
{
 $scheme="HP";
}
if(isset($_POST['submit']))
{ 
	$District_id=$_POST['district'];
	//$_SESSION['district']=$district;
	$Block_id=$_POST['form_id'];
	//$_SESSION['form_id']=$form_id;
	header('Location:ListP&Tscheme.php?DT='.$District_id.' && BC='.$Block_id.' && TS='.$scheme.'');
}	
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="css/style_question.css" type="text/css" rel="stylesheet" />
<script language="javascript" type="text/javascript" src="js/validate.js"></script>
<script language="Javascript" type="text/javascript" src="schemewiseListQ.js"></script>
<script language="javascript" type="text/javascript">
function validate()
{
	valid = true;
	if (document.view_main_q1.district.selectedIndex == 0)
    {
        alert ( "Please select District Name" );
        valid = false;
    }
	if (document.view_main_q1.form_id.selectedIndex == 0)
    {
        alert ( "Please select Form Id" );
        valid = false;
    }
	return valid;
}	
</script>
<title>P&T</title>
</head>
<body>
<div align="center">
<script type="text/javascript" src="js/json2.js"></script>
<script type="text/javascript" src="js/jquery.js"></script>

<script type="text/javascript" src="js/ajaxFunction_division_manage.js"></script>


 
<table border="0" width="746" id="table1" cellspacing="2" cellpadding="0">
	<thead>
	<tr>
	  <td height="1" align="left" valign="top" colspan="4">&nbsp;</td>
	  </tr>
	<tr bgcolor="#006EBD"><td height="29" align="left" valign="top" bgcolor="#C5D8EB" colspan="4">&nbsp;</td></tr>
	<tr><td bgcolor="#E5E5E5" align="center"  colspan="3">
	<span lang="en-us">&nbsp;</span><span lang="en-us" style="font-size: 8.5pt" ><font face="Verdana" color="#006699"><b><?php echo $scheme;?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Division Managment</b></font></span></td><td bgcolor="#E5E5E5" > <input type="text" name="se" id="se" onChange="ajax_content(this.value,1);" /></td>
	</tr>
	<tr><td height="23" colspan="4" align="left"><a href="Javascript:void(0);" onClick="$('#add_form').toggle();"><font face="Verdana" style="font-size: 8.5pt" color="#006699">&nbsp;Add New Division</font></a></td>
	</tr>
	<tr ><td  colspan="4" align="center"  ><form method="post" action="" onSubmit="return add_division('zone_option','circle_option','div_name','add_msg'); "  id="add_form" hidden>
	<div id="add_msg" style="font-size: 8.5pt; font-family:verdana; font-size:8.5pt;color:#000000;" ></div>
	<font style="font-size: 8.5pt" face="Verdana" color="#000000">Add Division: </font>
	<select name="zone_option" id="zone_option" onChange="load_circle(this.value,'circle_option');">
	<option value="0">select zone:</option>
	<?php
	$query = mysql_query("SELECT * FROM tbl_lookup_zone WHERE status = 1 ORDER BY zone_id");
	while($zone_option = mysql_fetch_assoc($query)) {
	?>
	
	<option value ="<?php echo $zone_option['zone_id']; ?>"><?php echo $zone_option['zone_name']; ?></option>;
	
	<?php
	}
	?>
	</select>
	<select name="circle_option" id="circle_option">
	<option value="0">select circle:</option>
	</select>
	
	<input type="text" name="div_name" id="div_name" />&nbsp;
	<input type="submit" value="Add" style="font-size: 8.5pt" face="Verdana" color="#000000"  />
	
	</form>
	&nbsp;
	</td>
	<td></td>
	</tr>
	
	<tr bgcolor="#E5E5E5"><th width="150" height="24" align="left"><font face="Verdana" style="font-size: 8.5pt" color="#000000">Zone</font></th>
	<th align="left" width="150"><font face="Verdana" style="font-size: 8.5pt" color="#000000">Circle</font></th><th width="700"><font face="Verdana" style="font-size: 8.5pt" color="#000000">Division Name</font></th><th colspan="2" "><font face="Verdana" style="font-size: 8.5pt" color="#000000">Action</font></th></tr>
	<tr><td colspan="4" id="circle_msg" align="center" style="font-size: 10pt; font-face:verdana; color:#AAAAAA; font-weight:bold;">&nbsp;</td></tr>
	</thead>
	<?php
	/*
	$query = mysql_query("SELECT * FROM tbl_lookup_division ORDER BY zone_id");
	while($zone = mysql_fetch_assoc($query)) {
	?>
	<tbody id="content_zone">
	<tr onMouseOver="this.style.backgroundColor='#E5E5E5';" onMouseOut="this.style.backgroundColor='#FFFFFF';" id="row_id_<?php echo $zone['div_id']; ?>" class="div_row"><td height="27" width="100"  ></td>
		<td width="700" id="div_id_<?php echo $zone['div_id']; ?>" ><font style="font-size: 8.5pt" face="Verdana" color="#000000"><?php echo $zone['div_name']; ?> ( <b><small><?php echo $zone['circle_name']; ?> , <?php echo $zone['zone_name']; ?> </small></b> ) </font></td>
		<td align="center" colspan="2" ><a href="Javascript:void(0);" onClick="edit_div('<?php echo $zone["div_id"]; ?>');" ><font style="font-size: 8.5pt" face="Verdana" color="#000000">Edit</font></a>
		&nbsp;&nbsp;&nbsp;
		<?php
			if($zone['status'] == "1") {
		?>
		<span id="state_id_<?php echo $zone['div_id']; ?>" ><a href="Javascript:void(0);" onClick="status_handler(0,'<?php echo $zone['div_id']; ?>');"  ><font style="font-size: 8.5pt" face="Verdana" color="#000000">Disable</font></a></span>
		<?php
		}
		else {
		?>
		<span id="state_id_<?php echo $zone['div_id']; ?>" ><a href="Javascript:void(0);" onClick="status_handler(1,'<?php echo $zone['div_id']; ?>');"  ><font style="font-size: 8.5pt" face="Verdana" color="#000000">Enable</font></a></span>
		<?php
		}
		?>
		
		</td>
		</tr>
		
	<?php
	}
	</tbody>	*/ ?>
	<tbody id="content_zone">
	
	</tbody>
	
	


	<tr><td colspan="4">&nbsp;</td></tr>
		
		</table>
</div>
</body>
</html>

	
